package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.InspectionActivityMapper;
import com.ruoyi.hospital.domain.InspectionActivity;
import com.ruoyi.hospital.service.IInspectionActivityService;

/**
 * 项目折扣活动Service业务层处理
 * 
 * @author qichi
 * @date 2023-07-05
 */
@Service
public class InspectionActivityServiceImpl implements IInspectionActivityService 
{
    @Autowired
    private InspectionActivityMapper inspectionActivityMapper;

    /**
     * 查询项目折扣活动
     * 
     * @param id 项目折扣活动主键
     * @return 项目折扣活动
     */
    @Override
    public InspectionActivity selectInspectionActivityById(Long id)
    {
        return inspectionActivityMapper.selectInspectionActivityById(id);
    }

    /**
     * 查询项目折扣活动列表
     * 
     * @param inspectionActivity 项目折扣活动
     * @return 项目折扣活动
     */
    @Override
    public List<InspectionActivity> selectInspectionActivityList(InspectionActivity inspectionActivity)
    {
        return inspectionActivityMapper.selectInspectionActivityList(inspectionActivity);
    }

    /**
     * 新增项目折扣活动
     * 
     * @param inspectionActivity 项目折扣活动
     * @return 结果
     */
    @Override
    public int insertInspectionActivity(InspectionActivity inspectionActivity)
    {
        inspectionActivity.setCreateTime(DateUtils.getNowDate());
        return inspectionActivityMapper.insertInspectionActivity(inspectionActivity);
    }

    /**
     * 修改项目折扣活动
     * 
     * @param inspectionActivity 项目折扣活动
     * @return 结果
     */
    @Override
    public int updateInspectionActivity(InspectionActivity inspectionActivity)
    {
        inspectionActivity.setUpdateTime(DateUtils.getNowDate());
        return inspectionActivityMapper.updateInspectionActivity(inspectionActivity);
    }

    /**
     * 批量删除项目折扣活动
     * 
     * @param ids 需要删除的项目折扣活动主键
     * @return 结果
     */
    @Override
    public int deleteInspectionActivityByIds(Long[] ids)
    {
        return inspectionActivityMapper.deleteInspectionActivityByIds(ids);
    }

    /**
     * 删除项目折扣活动信息
     * 
     * @param id 项目折扣活动主键
     * @return 结果
     */
    @Override
    public int deleteInspectionActivityById(Long id)
    {
        return inspectionActivityMapper.deleteInspectionActivityById(id);
    }
}
